﻿import QtQuick 2.0
import "../components"
import QtCharts 2.3
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.2
import QtQuick.Controls 2.12
import QtMultimedia 5.14
Rectangle {
    width: parent.width
    height: parent.height
    property string xh:""
    property string jcdm: ""
    property string jcxx: ""
    property bool ispbv: false

    signal refre()

    onVisibleChanged: {

    }

    Row{
        anchors.fill: parent

        // 名称
        Text{
            id: num
            height: 40*dp;
            width: parent.width*0.15
            font.pixelSize: config.fontsize
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
            anchors.verticalCenter: parent.verticalCenter
            text: xh
        }

        // 检测信息
        Item{
            height: parent.height; width: parent.width*0.3
            CustomComboMultiBox{
                id: code
                height: 40*dp;
//                width: parent.width*0.3
                model: ["放靶","打靶","转靶","纯化"]
                anchors.centerIn: parent
                editDefaultText: jcdm
                onCheckChanged: {
                    jcdm=code.getText()
                    CMaintenance.updateDetectorInformation(xh,jcdm,ispbv?"是":"否")
                    refre()
                }
            }
        }

        LineEditor{
            id: info
            visible: true
            height: 40*dp;
            editWidth: parent.width*0.4
            anchors.verticalCenter: parent.verticalCenter
            lengthVisible:false
            defaultText: jcxx
            editable:false
            onTextChanged: {

            }
        }
        // 操作
        Item{
            height: parent.height; width: parent.width*0.15
            CustomSwitchButton{
                height: 24*dp; width: 40*dp
                anchors.centerIn: parent
                id: ispb
                checked: ispbv
                CustomTooltip{
                    visible: parent.isHovered
                    text: "是否屏蔽"
                }
                onClicked: {
                    ispbv=!ispbv
                    CMaintenance.updateDetectorInformation(xh,jcdm,ispbv?"是":"否")
                }
            }
        }

    }
    Rectangle{
        x:0*dp
        y:parent.height-2*dp
        height: 1.2*dp
        width: parent.width
        color: "#DEDEDE"
    }



}
